<?php
/* @var $this CategoryController */
$this->layout = '//layouts/admin/category';
$this->pageTitle = '分类操作列表';
$this->breadcrumbs=array(
	'分类管理'
);
?>
<div class="container-fluid">
    <div class='navbar navbar-contrlpanel' style=''>
        <form class="navbar-form pull-left" style='width: 100%;'>
            <div class="span2 subnav-search-select" style='margin-right:5px;margin-left: 0px'>
                <select value="" class="span2" tabindex="1" name="herolist">
                    <option value="0">ID</option>
                    <option value="1">名称</option>
                    <option value="2">内容搜索</option>
                    <option value="3">日期搜索</option>
                </select>
            </div>
            <input type="text" class="span2 subnav-search-text">
            <button type="submit" class="btn btn-primary">搜索</button>
            <a id="createCategory" href="<?php echo Yii::app()->createUrl('/admin/category/create');?>" class="btn btn-primary">添加分类</a>
        </form>
    </div>
    <div class="row-fluid row-list-area">
        <div class="span12">
            <div class="tabbable"> <!-- Only required for left/right tabs -->
                <ul class="nav nav-tabs">
                    <?php foreach($category as $k=>$v):?>
                    <li class="<?php echo $k=='blog' ? 'active' : '';?>"><a href="#tab-<?php echo $k;?>" data-toggle="tab"><?php echo $v;?></a></li>
                    <?php endforeach;?>
                    
                </ul>
                <div class="tab-content tab-content-content">
                    <!-- 文章Start -->
                    <div class="tab-pane active" id="tab-blog">
                        <div class="table" style="min-height:300px">
                            <table class='table'>
                                <thead>
                                    <tr>
                                        <td>ID</td>
                                        <td>名称</td>
                                        <td>相关的文章数</td>
                                        <td>总浏览数</td>
                                        <td>创建时间</td>
                                        <td>更新时间</td>
                                        <td>操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($blogType as $k=>$v):?>
                                    <tr>
                                        <td><span class="badge"><?php echo $v->id;?></span></td>
                                        <td><?php echo $v->screen_name;?></td>
                                        <td><?php echo HelperCounter::blogSum($v->id);?>（篇）</td>
                                        <td><?php echo HelperCounter::blogReadSum($v->id);?>（次）</td>
                                        <td><?php echo $v->create_date;?></td>
                                        <td><?php echo $v->update_date;?></td>
                                        <td>
                                            <input type="hidden" value="<?php echo $v->id;?>" name="category-id">
                                            <a class="btn btn-primary" href='<?php echo Yii::app()->createUrl('admin/category/update',array('id'=>$v->id));?>'>编辑</a>
                                            <a class="btn <?php echo $v->is_delete ? '' : 'btn-primary';?>" id="category-delete" href='<?php echo Yii::app()->createUrl('admin/category/delete',array('id'=>$v->id));?>'>删除</a>
                                            <a class="btn <?php echo $v->is_lock ? '' : 'btn-primary';?>" id="category-lock" href='<?php echo Yii::app()->createUrl('admin/category/lock',array('id'=>$v->id));?>'>锁定</a>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- 文章End -->
                    
                    <!-- 文件Start -->
                    <div class="tab-pane" id="tab-file">
                        <div class="table" style="min-height:300px">
                            <table class='table'>
                                <thead>
                                    <tr>
                                        <td>ID</td>
                                        <td>名称</td>
                                        <td>相关的文件数</td>
                                        <td>总下载数</td>
                                        <td>创建时间</td>
                                        <td>更新时间</td>
                                        <td>操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($fileType as $k=>$v):?>
                                    <tr>
                                        <td><span class="badge"><?php echo $v->id;?></span></td>
                                        <td><?php echo $v->name;?></td>
                                        <td><?php echo HelperCounter::fileSum($v->id);?>（篇）</td>
                                        <td><?php echo HelperCounter::fileDownloadSum($v->id);?>（次）</td>
                                        <td><?php echo $v->create_date;?></td>
                                        <td><?php echo $v->update_date;?></td>
                                        <td>
                                            <input type="hidden" value="<?php echo $v->id;?>" name="category-id">
                                            <a class="btn btn-primary" href='<?php echo Yii::app()->createUrl('admin/category/update',array('id'=>$v->id));?>'>编辑</a>
                                            <a class="btn <?php echo $v->is_delete ? '' : 'btn-primary';?>" id="category-delete" href='<?php echo Yii::app()->createUrl('admin/category/delete',array('id'=>$v->id));?>'>删除</a>
                                            <a class="btn <?php echo $v->is_lock ? '' : 'btn-primary';?>" id="category-lock" href='<?php echo Yii::app()->createUrl('admin/category/lock',array('id'=>$v->id));?>'>锁定</a>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- 文件End -->
                    
                    <!-- 链接Start -->
                    <div class="tab-pane" id="tab-link">
                        <div class="table" style="min-height:300px">
                            <table class='table'>
                                <thead>
                                    <tr>
                                        <td>ID</td>
                                        <td>名称</td>
                                        <td>相关的链接数</td>
                                        <td>创建时间</td>
                                        <td>更新时间</td>
                                        <td>操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($linkType as $k=>$v):?>
                                    <tr>
                                        <td><span class="badge"><?php echo $v->id;?></span></td>
                                        <td><?php echo $v->name?></td>
                                        <td><?php echo HelperCounter::linkSum($v->id);?>（个）</td>
                                        <td><?php echo $v->create_date;?></td>
                                        <td><?php echo $v->update_date?></td>
                                        <td>
                                            <input type="hidden" value="<?php echo $v->id;?>" name="category-id">
                                            <a class="btn btn-primary" href='<?php echo Yii::app()->createUrl('admin/category/update',array('id'=>$v->id));?>'>编辑</a>
                                            <a class="btn <?php echo $v->is_delete ? '' : 'btn-primary';?>" id="category-delete" href='<?php echo Yii::app()->createUrl('admin/category/delete',array('id'=>$v->id));?>'>删除</a>
                                            <a class="btn <?php echo $v->is_lock ? '' : 'btn-primary';?>" id="category-lock" href='<?php echo Yii::app()->createUrl('admin/category/lock',array('id'=>$v->id));?>'>锁定</a>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- 链接End -->
                    
                    <!-- 用户 Start -->
                    <div class="tab-pane" id="tab-user">
                        <div class="table" style="min-height:300px">
                            <table class='table'>
                                <thead>
                                    <tr>
                                        <td>ID</td>
                                        <td>名称</td>
                                        <td>用户数</td>
                                        <td>创建日期</td>
                                        <td>操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($userType as $k=>$v):?>
                                    <tr>
                                        <td><span class="badge"><?php echo $v->id;?></span></td>
                                        <td><?php echo $v->screen_name;?></td>
                                        <td><?php echo HelperCounter::userSum($v->id);?>(个)</td>
                                        <td><?php echo $v->create_date;?></td>
                                        <td>
                                            <input type="hidden" value="<?php echo $v->id;?>" name="category-id">
                                            <a class="btn btn-primary" href='<?php echo Yii::app()->createUrl('admin/category/update',array('id'=>$v->id));?>'>编辑</a>
                                            <a class="btn <?php echo $v->is_delete ? '' : 'btn-primary';?>" id="category-delete" href='<?php echo Yii::app()->createUrl('admin/category/delete',array('id'=>$v->id));?>'>删除</a>
                                            <a class="btn <?php echo $v->is_lock ? '' : 'btn-primary';?>" id="category-lock" href='<?php echo Yii::app()->createUrl('admin/category/lock',array('id'=>$v->id));?>'>锁定</a>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- 用户End -->

                    <!-- 广告-Start -->
                    <div class="tab-pane" id="tab-ad">
                        <div class="table" style="min-height:300px">
                            <table class='table'>
                                <thead>
                                    <tr>
                                        <td>ID</td>
                                        <td>分类名称</td>
                                        <td>总数</td>
                                        <td>创建日期</td>
                                        <td>操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($adType as $k=>$v):?>
                                    <tr>
                                        <td><span class="badge"><?php echo $v->id;?></span></td>
                                        <td><?php echo $v->screen_name;?></td>
                                        <td><?php echo '0';?>(个)</td>
                                        <td><?php echo $v->create_date;?></td>
                                        <td>
                                            <input type="hidden" value="<?php echo $v->id;?>" name="category-id">
                                            <a class="btn btn-primary" href='<?php echo Yii::app()->createUrl('admin/ad/update',array('id'=>$v->id));?>'>编辑</a>
                                            <a class="btn <?php echo $v->is_delete ? '' : 'btn-primary';?>" id="category-delete" href='<?php echo Yii::app()->createUrl('admin/ad/delete',array('id'=>$v->id));?>'>删除</a>
                                            <a class="btn <?php echo $v->is_lock ? '' : 'btn-primary';?>" id="category-lock" href='<?php echo Yii::app()->createUrl('admin/ad/lock',array('id'=>$v->id));?>'>锁定</a>
                                        </td>
                                    </tr>
                                    <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- 广告---End -->
                    </div>
                </div>
            </div>
        </div>
        
    </div>
</div>
